import {Injectable, Injector} from '@angular/core';
import {Constant} from '@core/constant';
import {_HttpClient, SettingsService} from '@delon/theme';
import {MyHttpClient} from '../MyHttpClient';

@Injectable()
export class blListService {
  get cnt(): Constant {
    return this.injector.get(Constant);
  }

  constructor(
    private injector: Injector,
    private http: _HttpClient,
    private myHttp: MyHttpClient,
    public setting: SettingsService,
  ) {
  }

  /**
   * 分页获取供应商
   */
  list(): string {
    return `${this.cnt.baseUrl}/rest/srmBlPlanController/list/` + this.setting.user.username+"?type=00";
  }
  /**
   * 分页获取供应商
   */
  list01(): string {
    return `${this.cnt.baseUrl}/rest/srmBlPlanController/list/` + this.setting.user.username+"?type=01";
  }
  /**
   * 分页获取供应商
   */
  list02(): string {
    return `${this.cnt.baseUrl}/rest/srmBlPlanController/list/` + this.setting.user.username+"?type=02";
  }
  /**
   * 分页获取供应商
   */
  list03(): string {
    return `${this.cnt.baseUrl}/rest/srmBlPlanController/list/` + this.setting.user.username+"?type=03";
  }
  /**
   * 分页获取供应商
   */
  list04(): string {
    return `${this.cnt.baseUrl}/rest/srmBlPlanController/list/` + this.setting.user.username+"?type=04";
  }

  /**
   * 分页获取供应商
   */
  list0101(): string {
    return `${this.cnt.baseUrl}/rest/srmBlPlanController/list/` + this.setting.user.username+"?type=0101";
  }
  /**
   * 分页获取供应商
   */
  list0201(): string {
    return `${this.cnt.baseUrl}/rest/srmBlPlanController/list/` + this.setting.user.username+"?type=0201";
  }
  /**
   * 分页获取供应商
   */
  list0301(): string {
    return `${this.cnt.baseUrl}/rest/srmBlPlanController/list/` + this.setting.user.username+"?type=0301";
  }
  /**
   * 分页获取供应商
   */
  list0401(): string {
    return `${this.cnt.baseUrl}/rest/srmBlPlanController/list/` + this.setting.user.username+"?type=0401";
  }

  /**
   * 获取产品
   * @param id
   */
  getlfa1detail(id) {
    return this.http.get(`${this.cnt.baseUrl}/rest/srmBlPlanController/` + id);
  }

  /**
   * 修改产品
   * @param product
   */
  editLfa1(product) {
    return this.http.put(
      `${this.cnt.baseUrl}/rest/srmBlPlanController/${product.id}`,
      product,
    );
  }


  uploadcarinfo(): string {
    return `${this.cnt.baseUrl}/rest/srmBlPlanController/uploadexcel?type=00&username=` + this.setting.user.username;
  }
  uploadfile(): string {
    return `${this.cnt.baseUrl}/rest/srmBlPlanController/uploadfile?type=01&username=` + this.setting.user.username;
  }
  uploadcarinfo01(): string {
    return `${this.cnt.baseUrl}/rest/srmBlPlanController/uploadexcel?type=01&username=` + this.setting.user.username;
  }
  uploadcarinfo02(): string {
    return `${this.cnt.baseUrl}/rest/srmBlPlanController/uploadexcel?type=02&username=` + this.setting.user.username;
  }
  uploadcarinfo03(): string {
    return `${this.cnt.baseUrl}/rest/srmBlPlanController/uploadexcel?type=03&username=` + this.setting.user.username;
  }
  uploadcarinfo04(): string {
    return `${this.cnt.baseUrl}/rest/srmBlPlanController/uploadexcel?type=04&username=` + this.setting.user.username;
  }
  uploadcarinfo0101(): string {
    return `${this.cnt.baseUrl}/rest/srmBlPlanController/uploadexcelxiada?type=0101&username=` + this.setting.user.username;
  }
  uploadcarinfo0201(): string {
    return `${this.cnt.baseUrl}/rest/srmBlPlanController/uploadexcelxiada?type=0201&username=` + this.setting.user.username;
  }
  uploadcarinfo0301(): string {
    return `${this.cnt.baseUrl}/rest/srmBlPlanController/uploadexcelxiada?type=0301&username=` + this.setting.user.username;
  }
  uploadcarinfo0401(): string {
    return `${this.cnt.baseUrl}/rest/srmBlPlanController/uploadexcelxiada?type=0401&username=` + this.setting.user.username;
  }
}
